import Vue from 'vue'
import App from './App.vue'
import router from './router'


Vue.prototype.$bus = new Vue()
// 封装至network 便于后期维护
// import axios from 'axios'
// axios.defaults.baseURL = 'http://timemeetyou.com:8889/api/private/v1/'
// axios.interceptors.request.use(config => {
//   config.headers.Authorization = window.sessionStorage.getItem('token')
//   return config
// })
// Vue.prototype.$http = axios


// 导入element-ui库
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 导入字体图标库
import 'assets/fonts/iconfont.css'

// 导入树形控件
import TreeTable from 'vue-table-with-tree-grid'
Vue.component('tree-table', TreeTable)

// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
// 导入富文本编辑器样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// 全局注册
Vue.use(VueQuillEditor)

// 注册全局过滤器
Vue.filter('dateFormat', origin => {
  const dt = new Date(origin)

  const yy = dt.getFullYear()
  const MM = (dt.getMonth() + 1 + '').padStart(2, '0')
  const dd = (dt.getDate() + '').padStart(2, '0')

  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')

  return `${yy}-${MM}-${dd} ${hh}:${mm}:${ss}`
})
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')